/**
 * Created by yy on 2017/7/31.
 */

$(function() {
    var id = '';
    var url1 = location.search;
    if (url1.indexOf("?") != -1) {
    id = url1.substr(4);
    }

    var url0 = server + '/server/resume/search/byId.json';
    var args0 = {resumeId: id};
    $.post(url0, args0, function (data) {
        if (data.code == 12000) {
            alert("登录超时");
            window.location.replace('../../login.html');
        }
        $('.resume-name div input')[0].value = data.data.resumeName;

        $('.head-portrait-content  img').attr('src', data.data.photo);

        var arrEssentialInfo = data.data.essentialInfo.split(",");
        for (var i =0;i<$('.essential-information-content div label input').length;i++){
            $('.essential-information-content div label input')[i].value = arrEssentialInfo[i].split(":")[1];
        }

        var arrWorkExp = data.data.workExp.split(",");
        for (var i = 0;i<$('.work-experience-content ul li div h6 input').length;i++){
            $('.work-experience-content ul li div h6 input')[i].value = arrWorkExp[i].split("#")[0];
            $('.work-experience-content ul li div textarea')[i].value = arrWorkExp[i].split("#")[1];
        }

        $('.help-job div h6 input').value = data.data.expectPost.split("#")[0];
        $('.help-job div textarea').value = data.data.expectPost.split("#")[1];

        $('.self-introduction div textarea')[0].value = data.data.selfAssessment;
    });
});